import * as types from '../action-types';

interface incrementAction {
    type: string
}

interface decrementAction {
    type: string
}

export type Action = incrementAction | decrementAction;

export default {
    increment() {
        return function (dispatch, getState) {
            setTimeout(() => {
                console.log(getState())
                dispatch({type: types.INCREMENT})
            }, 1000);
        }
    },
    decrement() {
        return {type: types.DECREMENT}
    }
}